home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig07_04.jar / Ch07 / Fig07_04 / Date1.h < prev    next >
C/C++ Source or Header  |  1997-10-20  |  549b  |  23 lines

  1. // Fig. 7.4: date1.h 
  2. // Declaration of the Date class.
  3. // Member functions defined in date1.cpp
  4. #ifndef DATE1_H
  5. #define DATE1_H
  6.  
  7. class Date {
  8. public:
  9.    Date( int = 1, int = 1, int = 1900 ); // default constructor
  10.    void print() const;  // print date in month/day/year format
  11.    ~Date();  // provided to confirm destruction order
  12. private:
  13.    int month;  // 1-12
  14.    int day;    // 1-31 based on month
  15.    int year;   // any year
  16.  
  17.    // utility function to test proper day for month and year
  18.    int checkDay( int );
  19. };
  20.  
  21. #endif
  22.  
  23.